class Solution:
    def arrangeCoins(self, n):
        """
        :type n: int
        :rtype: int
        """
        maxNeed = 1
        res = 0
        while maxNeed <= n:
            res += 1
            maxNeed += res + 1

        return res

s = Solution()
print(s.arrangeCoins(0))
print(s.arrangeCoins(5))
print(s.arrangeCoins(8))
print(s.arrangeCoins(10))


